package com.jumi.microservice.dto.compensation;

import com.jumi.microservice.common.base.dto.BaseRequest;
import com.jumi.microservice.common.exception.BaseException;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author Scw
 * @date 2020-08-21 15:41
 * 🔨🔨🔨🔨🔨
 */
public class ExportCompensationStepRequest extends BaseRequest {
    @ApiModelProperty("售后类型: 0-弃货退款 1-补偿款 2-补偿邮费")
    private Byte afterSaleType;
    @ApiModelProperty("供货商类型：1-供货商 2-仓库")
    private Byte supplierType;
    @ApiModelProperty("供货商ID")
    private Integer supplierId;
    @ApiModelProperty("商品名称")
    private String goodsName;
    @ApiModelProperty(value = "批量ID , 逗号分割字符串")
    private String idStr;

    public Byte getAfterSaleType() {
        return afterSaleType;
    }

    public void setAfterSaleType(Byte afterSaleType) {
        this.afterSaleType = afterSaleType;
    }

    public Byte getSupplierType() {
        return supplierType;
    }

    public void setSupplierType(Byte supplierType) {
        this.supplierType = supplierType;
    }

    public Integer getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Integer supplierId) {
        this.supplierId = supplierId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getIdStr() {
        return idStr;
    }

    public void setIdStr(String idStr) {
        this.idStr = idStr;
    }

    @Override
    public void checkRequest() {
        if (
                this.afterSaleType == null && this.supplierType == null && this.supplierId == null && this.goodsName == null && this.idStr == null
        ) {
            throw new BaseException(500, "请先选择搜索条件");
        }
    }
}
